<template>
	<view>
		<view class="swiper-item1">
			
			<view class="firm_msg" v-for="item in outuser_lsit" @click="goUserDetail(item)">
				<image class="firm_msg_img" :src="item.avatar"></image>
				<text class="firm_msg_text">{{item.nickname}}</text>
				<image src="/static/firm/back2.png" class="back_img2"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				token: '',
				member_id: '',
				is_outuser: '',
				
				outuser_lsit:[]
			}
		},
		onLoad() {
			this.token = uni.getStorageSync('chat_token') || ''
			this.member_id = uni.getStorageSync('chat_member_id') || ''
			this.is_outuser = uni.getStorageSync('chat_is_outuser') || ''
			
		},
		onShow() {
			this.getOutApply()
		},
		methods: {
			goUserDetail(item){
				console.log(item)
				uni.navigateTo({
					url:'OutUserDetail?username=' + item.username + '&nickname=' + item.nickname + '&member_id=' + item.member_id 
				})
			},
			
			// 获取外部人员申请列表
			async getOutApply() {
				const res = await this.$myRequest({
					url: 'Chat/member_apply_list',
					method: 'POST',
					data: {
						token: this.token,
						member_id: this.member_id,
						is_outuser:this.is_outuser,
						company_id:'1'
					},
				});
				if (res.data.code != 200) return uni.showToast({
					title: res.data.datas.msg,
					icon: 'none'
				})
				this.outuser_lsit = res.data.datas.listInfo
				
			},
		}
	}
</script>

<style>
	.back_img2 {
		width: 14rpx;
		height: 28rpx;
		position: absolute;
		top: 40rpx;
		right: 30rpx;
	}
.firm_msg_text {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #333333;
		margin-left: 20rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.firm_msg_img {
		width: 62rpx;
		height: 62rpx;
		border-radius: 50%;
		margin-left: 31rpx;
		margin-top: 20rpx;
	}

	.firm_msg {
		width: 100%;
		height: 102rpx;
		background: #FFFFFF;
		border: 5rpx solid #F7F7F7;
		display: flex;
		position: relative;
	}
</style>
